from CyberU import *
f=jsonl(path=r'D:\autom\Repositories\gsAI\gsAI\content\qac\v1\data_1800_800.jsonl')
pass
f_out=txt(path=f'D:/autom/Repositories/gsAI/gsAI/content/qac/v2/{filename(f.path)}')
for dstr in f.l:
    try:
        d=json2dict(dstr)
        for qa in d['qa']:
            newd={
                'context':d['content'],
                'instruction':qa['question'],
                'input':'',
                'output':qa['answer'],
                # 'score_ifd':,
            }
            f_out.add(dict2json(newd),save=True)
    except Exception as e:
        warn(e)